package controller;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import domain.POS;

/**
 * Servlet implementation class GetTrafficController
 */
public class GetTrafficController extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public GetTrafficController() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
//		POS pos = new POS();
//		pos.setName("The Mall Bangkapi");
//		pos.setLatitute(13.766279);
//		pos.setLongtitute(100.642601);
//		
//		POS pos2 = new POS();
//		pos2.setName("The Mall Ramkhamhaeng 3");
//		pos2.setLatitute(13.752729);
//		pos2.setLongtitute(100.609644);
//		
//		ArrayList<POS> posList = new ArrayList<POS>();
//		posList.add(pos);
//		posList.add(pos2);
//		
//		request.setAttribute("posList", posList);
		
		RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/getTraffic.jsp");
		dispatcher.forward(request,response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
